<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<!-- <script type="text/javascript" src="js/jquery-1.8.3.js"/></script> -->
<!-- <script type="text/javascript" src="laypage/laypage.js"></script> -->
<link rel="stylesheet" type="text/css" href="css\layui.css"> 
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="css\bootstrap.min.css">
</head>
<body>
<script type="text/javascript">
$(function(){
	$.ajax({
		url:'listGoods',
		type:'post',
		dataType:'json',
		async:true,
		success:function(result){
			//console.log("你好listGoods");
			vue.list=result;
		}
	});
});
var vue=new Vue({
	el:'#app',
	data:{
		list:""
	},
	methods:{
		addOrder:function(g_gz_gc_id,gprice,gsum,gtime,u_Id,gphoto,gdetail,goodsAllClass,gid){
			/* console.log(gtime);
			console.log(u_Id);
			console.log(gdetail); */
			if(gsum>0){
				gsum=1;
				$("#td01").html(gprice);
				$("#td02").html(gsum);
				$("#td03").attr("src",gphoto);
				$("#td04").html(gtime);
				$("#td05").html(gdetail);
				$.ajax({
					url:'addBuyGoodsByGoods',
					data:{"g_gz_gc_id":g_gz_gc_id,"gprice":gprice,"gsum":gsum,"gtime":gtime,"u_Id":u_Id,"gphoto":gphoto,"gdetail":gdetail,"goodsAllClass":goodsAllClass},
					dataType:'json',
					type:'post',
					async:true,
					success:function(result){
						//console.log(result.bsum);
					}
				});
				//加入订单数量减1
				$.ajax({
					url:'deleteGoodsCount',
					data:{"gid":gid},
					dataType:'json',
					type:'post',
					async:true,
					success:function(result){
						console.log(result.gid);
					}
				});
			}else{
				
			}
			
		}
	}
});
</script>
</body>
</html>